//
//  CollectionViewCell.m
//  RSW.IOS
//
//  Created by zhaiqiuqiu on 16/12/3.
//  Copyright © 2016年 com.xtion.crm. All rights reserved.
//

#import "CollectionViewCell.h"

@interface CollectionViewCell()
{
   UIImageView *_imgView;
   UILabel *_text;
}
@end

@implementation CollectionViewCell

@synthesize szTag;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
    
        _imgView = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5, CGRectGetWidth(self.contentView.frame)-30, CGRectGetHeight(self.contentView.frame)-30)];
        [self addSubview:_imgView];
        
        _text = [[UILabel alloc]initWithFrame:CGRectMake(5, CGRectGetMaxY(_imgView.frame), CGRectGetWidth(self.contentView.frame), 20)];
        _text.backgroundColor = [UIColor whiteColor];
        _text.textAlignment = NSTextAlignmentCenter;
        _text.textColor = [UIColor grayColor];
        _text.font = [UIFont systemFontOfSize:13];

        [self addSubview:_text];
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    
    _imgView.centerX = self.contentView.centerX;
    _text.centerX = self.contentView.centerX;
}


- (void)setBgImg:(UIImage *)bgImg
{
    _imgView.image = bgImg;
}

- (void)setTitle:(NSString *)title
{
    _text.text = title;
}

- (void)setTitleFont:(UIFont *)titleFont
{
    _text.font = titleFont;
}

@end
